Data processing device

ABSTRACT

The present invention relates to a data processing apparatus. Additional information is embedded in coded data obtained by encoding image data, without increasing the amount of the coded data, and the data in which the additional information is embedded is correctly decoded into the image data and the additional information. An embedded compression encoder  11  encodes image data according to a predetermined coding rule, and destroys the coding rule based on additional information, thereby embedding the additional information. A decoder  12  restores the embedded coded data, obtained by embedding the additional information in the coded data, into the coded data encoded according to the coding rule, thereby decoding the additional information and also decoding the coded data into the image data.

TECHNICAL FIELD

The present invention relates to data processing apparatuses. Morespecifically, it relates to a data processing apparatus that allowsinformation to be embedded in an image without degrading the quality ofdecoded image or increasing the amount of data.

BACKGROUND ART

Methods for embedding information in data without increasing the amountof the data exist, for example, changing the lowest bit or low-order twobits of digital audio data into information to be embedded. The methodsimply replaces lower bits of digital audio data with information to beembedded, taking advantage of the fact that the lower bits do notsignificantly affect the quality of sound. Thus, when the digital audiodata is played back, the digital audio data with the informationembedded therein is output as it is without restoring the lower bits.That is, since it is difficult to restore the lower bits, in whichinformation is embedded, into the original digital audio data, and thelower bits do not significantly affect the quality of sound, the digitalaudio data is output with the information embedded therein.

According to the method described above, however, data that differs fromthe original data is output. Thus, considerable effect is exerted uponthe sound quality when the data is audio data or upon the picturequality when the data is video data.

DISCLOSURE OF INVENTION

The present invention has been made in view of the situation describedabove, and it allows information to be embedded, for example, in animage without degrading the picture quality or increasing the amount ofdata.

A first data processing apparatus according to the present inventionincludes encoding means for encoding first data to output coded data;and embedding means for embedding second data in the coded data outputfrom the encoding means by modifying a portion of the coded data basedon the second data.

A first data processing method according to the present invention issuch that first data is encoded to output coded data, and a portion ofthe coded data is modified based on the second data so that the seconddata is embedded in the coded data.

A first storage medium according to the present invention stores such aprogram that first data is encoded to output coded data, and a portionof the coded data is modified based on the second data so that thesecond data is embedded in the coded data.

According to the first data processing apparatus, data processingmethod, and storage medium of the present invention, first data isencoded to output coded data. Then, a portion of the coded data ismodified based on the second data so that the second data is embedded inthe coded data.

A second data processing apparatus according to the present inventionincludes coding table creation means for creating a coding table forencoding first data; modified coding table creation means for modifyingthe coding table created by the coding table creation means based onsecond data to create a modified coding table; and embedded coded datageneration means for encoding the first data based on the modifiedcoding table to generate embedded coded data in which the second data isembedded.

A second data processing method according to the present invention issuch that a coding table for encoding first data is created, the codingtable created is modified based on second data to create a modifiedcoding table, and the first data is encoded based on the modified codingtable to generate embedded coded data in which the second data isembedded.

A second storage medium according to the present invention stores such aprogram that a coding table for encoding first data is created, thecoding table created is modified based on second data to create amodified coding table, and the first data is encoded based on themodified coding table to generate embedded coded data in which thesecond data is embedded.

According to the second data processing apparatus, data processingmethod, and storage medium of the present invention, a coding table forencoding first data is created, and the coding table created is modifiedbased on second data to create a modified coding table. Then, the firstdata is encoded based on the modified coding table to generate embeddedcoded data in which the second data is embedded.

A third data processing apparatus according to the present inventionincludes tentative decoding means for tentatively decoding embeddedcoded data encoded by embedding second data in first data, based on acoding table, to output tentative decoded data; tentative coding tablecreation means for creating a tentative coding table based on thetentative decoded data; first decoded data obtaining means for decodingthe embedded coded data based on the coding table and the tentativecoding table to obtain first decoded data; and second decoded dataobtaining means for obtaining second decoded data by comparing thecoding table with the tentative coding table.

A third data processing method according to the present invention issuch that embedded coded data encoded by embedding second data in firstdata is tentatively decoded based on a coding table to output tentativedecoded data, a tentative coding table is created based on the tentativedecoded data, the embedded coded data is decoded based on the codingtable and the tentative coding table to obtain first decoded data, andthe coding table is compared with the tentative coding table to obtainsecond decoded data.

A third storage medium according to the present invention stores such aprogram that embedded coded data encoded by embedding second data infirst data is tentatively decoded based on a coding table to outputtentative decoded data, a tentative coding table is created based on thetentative decoded data, the embedded coded data is decoded based on thecoding table and the tentative coding table to obtain first decodeddata, and the coding table is compared with the tentative coding tableto obtain second decoded data.

According to the third data processing apparatus, data processingmethod, and storage medium of the present invention, embedded coded dataencoded by embedding second data in first data is tentatively decodedbased on a coding table to output tentative decoded data. Furthermore, atentative coding table is created based on the tentative decoded data,and the embedded coded data is decoded based on the coding table and thetentative coding table to obtain first decoded data. The coding table iscompared with the tentative coding table to obtain second decoded data.

A fourth data processing apparatus according to the present inventionincludes tentative decoding means for modifying a portion of embeddedcoded data encoded by embedding second data in first data according toan input parameter, and for tentatively decoding it based on a codingtable to output tentative decoded data; re-encoding means forre-encoding the tentative decoded data to output re-encoded data; anddecoding means for determining the parameter by comparing the embeddedcoded data and the re-encoded data, outputting tentative decoded data asfirst decoded data, obtained by tentatively decoding, based on thecoding table, the embedded coded data having been partially modified bythe tentative decoding means based on the parameter, and for obtainingsecond decoded data corresponding to the parameter.

A fourth data processing method according to the present invention issuch that a portion of embedded coded data encoded by embedding seconddata in first data is modified according to an input parameter, andtentatively decoded based on a coding table to output tentative decodeddata, the tentative decoded data is re-encoded to output re-encodeddata, and the parameter is determined by comparing the embedded codeddata and the re-encoded data, and tentative decoded data obtained bytentatively decoding, based on the coding table, the embedded coded datahaving been partially modified based on the parameter, is output asfirst decoded data, and for second decoded data corresponding to theparameter is also obtained.

A fourth storage medium according to the present invention stores such aprogram that a portion of embedded coded data encoded by embeddingsecond data in first data is modified according to an input parameter,and tentatively decoded based on a coding table to output tentativedecoded data, the tentative decoded data is re-encoded to outputre-encoded data, and the parameter is determined by comparing theembedded coded data and the re-encoded data, and tentative decoded dataobtained by tentatively decoding, based on the coding table, theembedded coded data having been partially modified based on theparameter, is output as first decoded data, and for second decoded datacorresponding to the parameter is also obtained.

According to the fourth data processing apparatus, data processingmethod, and storage medium of the present invention, a portion ofembedded coded data encoded by embedding second data in first data ismodified according to an input parameter, and tentatively decoded basedon a coding table to output tentative decoded data. Furthermore, thetentative decoded data is re-encoded to output re-encoded data. Theparameter is determined by comparing the embedded coded data and there-encoded data, and tentative decoded data obtained by tentativelydecoding, based on the coding table, the embedded coded data having beenpartially modified based on the parameter, is output as first decodeddata, and for second decoded data corresponding to the parameter is alsoobtained.

A fifth data processing apparatus according to the present inventionincludes encoding means for encoding first data according to a codingrule to output coded data; and modification means for modifying thecoding rule based on second data; wherein the encoding means encodes thefirst data according to a coding rule modified by the modificationmeans, thereby generating embedded coded data in which the second datais embedded.

A fifth data processing method according to the present invention issuch that first data is encoded according to a coding rule to outputcoded data, the coding rule is modified based on second data, and thefirst data is encoded according to the modified coding rule to generateembedded coded data in which the second data is embedded.

A fifth storage medium according to the present invention stores such aprogram that first data is encoded according to a coding rule to outputcoded data, the coding rule is modified based on second data, and thefirst data is encoded according to the modified coding rule to generateembedded coded data in which the second data is embedded.

According to the fifth data processing apparatus, data processingmethod, and storage medium of the present invention, first data isencoded according to a coding rule to output coded data. Then, thecoding rule is modified based on second data, and the first data isencoded according to the modified coding rule to generate embedded codeddata in which the second data is embedded.

A sixth data processing apparatus according to the present inventionincludes first decoding means for decoding embedded coded data obtainedby embedding second data in first data, to obtain coded data encodedaccording to an entropy coding rule and to obtain the second data; andsecond decoding means for decoding the coded data to obtain the firstdata.

A sixth data processing method according to the present invention issuch that embedded coded data obtained by embedding second data in firstdata is decoded to obtain coded data encoded according to an entropycoding rule and to obtain the second data, and the coded data is decodedto obtain the first data.

A sixth storage medium according to the present invention stores such aprogram that embedded coded data obtained by embedding second data infirst data is decoded to obtain coded data encoded according to anentropy coding rule and to obtain the second data, and the coded data isdecoded to obtain the first data.

According to the sixth data processing apparatus, data processingmethod, and storage medium of the present invention, embedded coded dataobtained by embedding second data in first data is decoded to obtaincoded data encoded according to an entropy coding rule and to obtain thesecond data. Furthermore, the coded data is decoded to obtain the firstdata.

A data processing system according to the present invention includes anencoding apparatus including encoding means for encoding first dataaccording to a coding rule to output coded data; and modification meansfor modifying the coding rule based on second data; wherein the encodingmeans encodes the first data according to a coding rule modified by themodification means to generate embedded data in which the second data isembedded, the data processing system also including a decoding apparatusincluding first decoding means for decoding embedded coded data toobtain the coded data encoded according to the coding rule and to obtainthe second data; and second decoding means for decoding the coded datato obtain the first data.

According to the data processing system of the present invention, in theencoding apparatus, first data is encoded according to a coding rule tooutput coded data. Then, the coding rule is modified based on seconddata, and the first data is encoded according to the modified codingrule to generate embedded data in which the second data is embedded. Inthe decoding apparatus, embedded coded data is decoded to obtain thecoded data encoded according to the coding rule and to obtain the seconddata. Then, the coded data is decoded to obtain the first data.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram showing an example construction of an embeddedcompression/decoding system according to an embodiment of the presentinvention.

FIG. 2 is a block diagram showing a first example construction of anembedded compression encoder 11.

FIG. 3 is a block diagram showing an example construction of avariable-length encoding unit 23.

FIG. 4 is a diagram showing variable-length decoding.

FIG. 5 is a diagram showing the relationship between the frequencies ofoccurrence of pixel values and code lengths of codes assigned to thepixel values.

FIG. 6 is a diagram showing an example Huffman table.

FIG. 7 is a diagram showing codes assigned in accordance with thefrequencies of occurrence of pixel values, and translation of the codes.

FIG. 8 is a diagram showing an example of embedded coded data.

FIG. 9 is a diagram showing a method for restoring embedded coded datainto original coded data.

FIG. 10 is a flowchart showing an embedded coding process.

FIG. 11 is a flowchart showing a translation table creation process.

FIG. 12 is a flowchart showing a coded data translation process.

FIG. 13 is a block diagram showing a second example construction of theembedded compression encoder 11.

FIG. 14 is a block diagram showing a first example construction of adecoder 12.

FIG. 15 is a block diagram showing an example construction of avariable-length decoding unit 52 and a variable-length decoding unit 56.

FIG. 16 is a block diagram showing an example construction of a Huffmantable creation unit 53.

FIG. 17 is a block diagram showing an example construction of a reversetranslation table creation unit 54.

FIG. 18 is a flowchart showing a decoding process.

FIG. 19 is a block diagram showing a third example construction of theembedded compression encoder 11.

FIG. 20 is a flowchart showing an embedded coding process.

FIG. 21 is a block diagram showing an example construction of anencoding unit 91.

FIG. 22 is a diagram showing encoding by vector quantization.

FIG. 23 is a block diagram showing an example construction of anembedding unit 92.

FIG. 24 is a diagram showing embedding of additional information by linerotation.

FIG. 25 is a flowchart showing an embedded coding process.

FIG. 26 is a block diagram showing a second example construction of thedecoder 12.

FIG. 27 is a flowchart showing a decoding process.

FIG. 28 is a block diagram showing an example construction of a codingrule restoring unit 121.

FIG. 29 is a block diagram showing an example construction of a decodingunit 122.

FIG. 30 is a block diagram showing an example construction of adetermination unit 123.

FIG. 31 is a diagram showing a process executed by the determinationunit 123.

FIG. 32 is a flowchart showing a decoding process.

FIG. 33 is a block diagram showing a third example construction of thedecoder 12.

FIG. 34 is a block diagram showing an example construction of a computeraccording to an embodiment of the present invention.

BEST MODE FOR CARRYING OUT THE INVENTION

FIG. 1 is an example construction of an embedded compression/decodingsystem (a system refers to a logical combination of a plurality ofapparatuses, irrespective of whether the constituent apparatuses residesin the same casing) according to an embodiment of the present invention.

The embedded compression/decoding system includes an encoding apparatus1 and a decoding apparatus 2. The encoding apparatus 1 encodes, forexample, an image to be encoded, and the decoding apparatus 2 decodesthe result of the encoding into the original image.

The encoding apparatus 1 includes an embedded compression encoder 11. Tothe embedded compression encoder 11, an image to be encoded andinformation to be embedded in the image (hereinafter referred to asadditional information when appropriate) are supplied. The embeddedcompression encoder 11 encodes the image (digital image data) forcompression according to a predetermined coding rule, and modifies ordestroys the coding rule based on the additional information (digitaldata), thereby embedding the additional information to yield embeddedcoded data for output. The embedded coded data output from the embeddedcompression encoder 11 is recorded on a recording medium 3, for example,a semiconductor memory, a magneto-optical disk, a magnetic disk, anoptical disk, a magnetic tape, or a phase-change disk, or transmittedvia a transmission medium 4, for example, a terrestrial wave, asatellite link, a CATV (Cable Television) network, the Internet, or apublic network, and is thus provided to the decoding apparatus 2.

The decoding apparatus 2 includes the decoder 12, which receives theembedded coded data provided via the recording medium 3 or thetransmission medium 4. The decoder 12 restores the embedded coded datainto the coded data encoded according to the predetermined coding rule,thereby decoding the additional information embedded therein and alsodecoding the coded data into the original image. The decoded image issupplied to and displayed on a monitor, not shown, or the like.

It is to be understood that the additional information may include, forexample, text data or sound data associated with the original image, areduced version of the image, etc., and may include data irrelevant tothe original image. That is, arbitrary data (including a program) can beused as the additional information.

Furthermore, part of an image supplied to the embedded compressionencoder 11 for encoding may also be used as the additional information.That is, it is possible to supply part of the image as additionalinformation to the embedded compression encoder 11 while also supplyingthe rest of the image as data to be encoded.

FIG. 2 shows an example construction of the embedded compression encoder11 shown in FIG. 1.

A frame memory 21 stores image data supplied to the embedded compressionencoder 11, for example, on a frame basis. An additional informationmemory 22 stores additional information supplied to the embeddedcompression encoder 11.

A variable-length encoding unit 23 applies variable-length coding orentropy coding, for example, Huffman coding, on the image data stored inthe frame memory 21, and supplies the resulting coded data to a codingrule destroying unit 25. The variable-length encoding unit 23 creates aHuffman table in the process of Huffman encoding in a manner to bedescribed later, and supplies the Huffman table to a translation tablecreation unit 24. Furthermore, the variable-length encoding unit 23supplies information related to Huffman table, to a MUX (multiplexer)26, which will be required in obtaining the Huffman table output to thetranslation table creation unit 24.

The translation table creation unit 24 creates, based on the additionalinformation stored in the additional information memory 22, atranslation table for translating codes in the Huffman table suppliedfrom the variable-length encoding unit 23. That is, the Huffman tabledefines association between values to be Huffman-encoded (pixel valuesof the image herein) and codes having different code lengths (codeddata), and the translation table creation unit 24 creates a translationtable for translating the codes in the Huffman table into codes based onthe additional information. The translation table created by thetranslation table creation unit 24 is supplied to the coding ruledestroying unit 25.

The coding rule destroying unit 25 modifies or destroys the coding rulein the variable-length encoding unit 23 based on the additionalinformation, thereby embedding the additional information. That is, thecoding rule destroying unit 25 translates (manipulates) the coded data(codes) output from the variable-length encoding unit 23, according tothe translation table created by the translation table creation unit 24based on the additional information, thereby yielding coded data encodedaccording to a coding rule in which the coding rule in thevariable-length encoding unit 23 is destroyed. The coded data encodedaccording to the destroyed coding rule is supplied from the coding ruledestroying unit 25 to the MUX 26 as embedded coded data obtained byembedding additional information in the original coded data.

The MUX 26 multiplexes the embedded coded data from the coding ruledestroying unit 25 and the information related to Huffman table from thevariable-length encoding unit 23, outputting the multiplexed data. Asdescribed with reference to FIG. 1, the multiplexed data is supplied tothe decoding apparatus 2 via the recording medium 3 or the transmissionmedium 4.

FIG. 3 shows an example construction of the variable-length encodingunit 23 shown in FIG. 2.

Each frame of the image data stored in the frame memory 21 shown in FIG.2 is sequentially considered, for example, in time order, and the imagedata of the frame under consideration is read. The image data of theframe under consideration is supplied to a frequency table creation unit31 and to an encoding unit 34.

The frequency table creation unit 31 creates a frequency table for thepixels constituting the frame under consideration supplied thereto, inwhich each pixel value is associated with the frequency of occurrencethereof, and supplies it to a Huffman tree creation unit 32. Thefrequency table is also supplied from the frequency table creation unit31 to the MUX 26 shown in FIG. 3 as information related to Huffmantable.

Although the frequency table is used as information related to Huffmantable in the embodiment shown in FIG. 3, the information related toHuffman table is not specifically limited as long as the informationallows a Huffman table created by a Huffman table creation unit 33,which will be described later, to be obtained. Thus, the informationrelated to Huffman table may be, for example, the Huffman table itselfcreated by the Huffman table creation unit 33, as well as the frequencytable.

The Huffman tree creation unit 32 creates what is called a Huffman treebased on the frequency table supplied from the frequency table creationunit 31, and supplies it to the Huffman table creation unit 33. TheHuffman table creation unit 33 creates a Huffman table based on theHuffman tree supplied from the Huffman tree creation unit 32. That is,the Huffman table creation unit 33 creates a Huffman table in whichpixel values in the frame under consideration are each assigned a codehaving a shorter code length in accordance with the frequency ofoccurrence of the pixel value being higher (a code having a longer codelength in accordance with the frequency of occurrence being lower). TheHuffman table is supplied to the encoding unit 34 and also to thetranslation table creation unit 24 shown in FIG. 2.

The encoding unit 34 sequentially considers each pixel in the frameunder consideration supplied thereto, for example, in order of rasterscanning, and translates the pixel value of the pixel underconsideration into the corresponding code in the Huffman table suppliedfrom the Huffman table creation unit 33, outputting it as coded data.

In the variable-length encoding unit 23 constructed as described above,the frequency table creation unit 31 creates a frequency table for aframe under consideration, which is supplied to the Huffman treecreation unit 32. The Huffman tree creation unit 32 creates a Huffmantree based on the frequency table supplied from the frequency tablecreation unit 31, which is supplied to the Huffman table creation unit33. The Huffman table creation unit 33 creates a Huffman table based onthe Huffman tree supplied from the Huffman tree creation unit 32, whichis supplied to the encoding unit 34. The encoding unit 34 translateseach pixel value in the frame under consideration into a code associatedwith the pixel value in the Huffman table, which is output as codeddata.

Now, a variable-length encoding process in the variable-length encodingunit 23 will be further described with reference to FIG. 4.

Let is be supposed, for example, that a frequency table as shown in FIG.4(A) has been created in the frequency table creation unit 31. FIG. 4(A)shows pixel values [0], [1], [2], [3], and [4] as having occurred fivetimes, four times, three times, twice, and once in a frame underconsideration, respectively.

In relation to the frequency table in FIG. 4(A), the Huffman treecreation unit 32 creates a Huffman tree in a bottom-up manner based onthe frequency of occurrence of each pixel value, for example, as shownin FIGS. 4(B) to 4(E).

More specifically, the Huffman tree creation unit 32 selects pixelvalues with the two lowest frequencies of occurrence from the pixelvalues in the frequency table, thereby forming a node. Furthermore, theHuffman tree creation unit 32 assigns either bit “0” or bit “1” to theone with the lower frequency of occurrence of the selected two pixelvalues, for example, “0”, assigning “1” to the other. The Huffman treecreation unit 32 assigns the sum of the frequencies of occurrence of theselected two pixel values to the node formed by the selected two pixelvalues as the frequency of occurrence of the node.

Thus, in the frequency table shown in FIG. 4(A), pixel value [4] havinga frequency of occurrence 1 and pixel value [3] having a frequency ofoccurrence 2 are selected, forming a node #1, and 3 (=1+2) is assignedas the frequency of occurrence of the node #1, as shown in FIG. 4(B).Furthermore, of the selected two pixel values [4] and [3], bit “0” isassigned to pixel value [4], having a lower frequency of occurrence, andbit “1” is assigned to pixel value [3], having a higher frequency ofoccurrence.

In FIGS. 4(B) to 4(E), numerals representing frequencies of occurrenceare shown in parentheses.

If the frequencies of occurrence of the two selected pixel values arethe same, bits “0” or “1” may be assigned to either one of the pixelvalues. However, to which of the pixel values bits “0” or “1” is to beassigned must be predetermined, for example, assigning bit “0” to thesmaller pixel value.

The Huffman tree creation unit 32 repeats the same process untilconvergence to a single node is achieved.

Thus, from the state shown in FIG. 4(B), the node #1 and pixel value [2]each having a frequency of occurrence 3 are selected, so that the node#1 and pixel value [2] form a node #2, as shown in FIG. 4(C).Furthermore, the frequency of occurrence of the node #2 is set to 6(=3+3), and bits “0” and “1” are assigned to the node #1 and pixel value[2], respectively.

From the state shown in FIG. 4(C), pixel value [1] having a frequency ofoccurrence 4 and pixel value [0] having a frequency of occurrence 5 areselected, so that pixel values [1] and [0] form a node #3. Furthermore,the frequency of occurrence of the node #3 is set to 9 (=4+5), and bits“0” and “1” are assigned to pixel values [1] and [0], respectively, asshown in FIG. 4(D).

From the state shown in FIG. 4(D), the node #2 having a frequency ofoccurrence 6 and the node #3 having a frequency of occurrence 9 areselected, so that the nodes #2 and #3 form a node #4. Furthermore, thefrequency of occurrence of the node #4 is set to 15 (=6+9), and bits “0”and “1” are assigned to the nodes #2 and #3, respectively, as shown inFIG. 4(E).

In the state shown in FIG. 4(E), the nodes have been converged to thesingle node #4, so that the Huffman tree is complete. The Huffman treecreation unit 32 supplies the Huffman tree to the Huffman table creationunit 33.

The Huffman table creation unit 33 recognizes a code assigned to eachpixel value by tracking the Huffman tree from the convergence node inthe direction of a pixel value.

More specifically, for example, the Huffman tree shown in FIG. 4(E) istracked from the node #4 in the direction of pixel value [0], and asequence of bits assigned to the nodes (or pixel values) is found as“0”→“0”→“0”. Accordingly, the Huffman table creation unit 33 recognizesthat code “000” is assigned to pixel value [0]. Also, the Huffman treeshown in FIG. 4(E) is tracked from the node #4 in the direction of pixelvalue [1], and a sequence of bits assigned to the nodes is found as“0”→“0”→“1”. Accordingly, the Huffman table creation unit 33 recognizesthat code “001” is assigned to pixel value [1].

Similarly, the Huffman table creation unit 33 recognizes a code assignedto each pixel value, thereby creating a Huffman table representingassociation between pixel values and codes. Thus, from the Huffman treeshown in FIG. 4(E), a Huffman table as shown in FIG. 4(F) is created.

The variable-length encoding unit 23 may alternatively performvariable-length encoding, for example, in the manner disclosed in U.S.Pat. No. 5,021,782.

In the Huffman table shown in FIG. 4(E), codes “11”, “10”, “01”, “001”,and “000” are assigned to pixel values [0], [1], [2], [3], and [4]having frequencies of occurrence 5, 4, 3, 2, and 1, respectively. Thus,basically, codes of shorter code lengths are assigned in accordance withthe frequencies of occurrence being higher.

In the Huffman table shown in FIG. 4(E), although pixel values [0], [1],[2], [3], and [4] have different frequencies of occurrence, codes in twobits are assigned to pixel values [0], [1], and [2] having relativelyhigher frequencies of occurrence, whereas codes in three bits areassigned to pixel values [3] and [4] having relatively lower frequenciesof occurrence.

As described above, in a Huffman table, codes having the same codelength are sometimes assigned to pixel values having differentfrequencies of occurrence. The relationship between frequencies ofoccurrence of pixel values and length of codes assigned to the pixelvalues are generally as shown in FIG. 5.

Referring to FIG. 5, assuming that n-bit codes are assigned to x pixelvalues (x is an integer not exceeding 2^(n)), the number of patterns ofassignment of the n-bit codes to the x pixel values is X! (! denotesfactorial), only one of which is adopted based on the rule for creatingthe Huffman tree described above.

Even if the pattern of assignment of the n-bit codes to the x pixelvalue is modified, the amount of codes does not increase. That is, in aHuffman table, even if an n-bit code is assigned to a pixel valueinstead of another n-bit code, the code length assigned remains as nbits, and thus the amount of codes does not increase.

Furthermore, even if the pattern of assignment of the n-bit codes to thex pixel values is modified, the pattern of code assignment can berestored, for example, based on the frequencies of occurrence of x pixelvalues.

From the above, even if the pattern of assignment of codes of the samelength to pixel values is modified in a Huffman table, that is, even ifa coding rule for variable-length encoding is destroyed, the amount ofcodes does not increase, and the modified assignment pattern can berestored to the original one.

This implies that, by modifying the pattern of assignment of codes topixel values based on some information, information can be embeddedwithout increasing the total amount of data while allowing the embeddedinformation to be decoded without overhead.

FIG. 6 shows an example of a Huffman table created for pixel valuesrepresented in eight bits (0 to 255). In FIG. 6, in addition to pixelvalues and codes (coded data) assigned to pixel values, the frequency ofoccurrence of each of the pixel values is shown.

Referring to FIG. 6, for example, with regard to seven pixel values from[12] to [18], a nine-bit code is assigned to each of the seven pixelvalues, and thus 7! patterns of assignment of the nine-bit codes to theseven pixel values exist. Thus, by modifying the pattern of assignmentof the nine-bit codes to the seven pixel values, int[log₂7!] bits ofinformation can be embedded. int[ ] represents the largest integer valuenot exceeding the value in [ ].

FIG. 7(A) is a graph showing the respective frequencies of occurrence ofpixel values [12] to [18] shown in FIG. 6, and FIG. 7(B) shows nine-bitcodes respectively assigned to pixel values [12] to [18] in FIG. 6.

Let it be supposed that the code assignment shown in FIG. 7(B) ismodified based on additional information within int[log₂7!] bits, forexample, as shown in FIG. 7(C).

More specifically, in FIG. 7(B), codes “110111111”, “110111010”,“110100001”, “110011001”, “11011000”, “011101011”, and “010001010” areassigned to pixel values [12] to [18], respectively. In FIG. 7(C), theassignment is modified so that code “110111111”, which has been assignedto pixel value [12], is now assigned to pixel value [15], code“110011001”, which has been assigned to pixel value [15], is nowassigned to pixel value [12], code “11011000”, which has been assignedto pixel value [16], is now assigned to pixel value [17], code“011101011”, which has been assigned to pixel value [17], is nowassigned to pixel value [18], and code “010001010”, which has beenassigned to pixel value [18], is now assigned to pixel value [16].Assignment of codes to other pixel values is not modified in FIG. 7.

Also for pixel values to which codes of other code lengths are assigned,pattern of code assignment can be modified based on the additionalinformation. FIG. 8 shows an example of embedded coded data,constituting coded data in which the pattern of code assignment shown inFIG. 6 has been modified based on the additional information. FIG. 8shows, together with the embedded coded data, decoded pixel valuesobtained by variable-length decoding the embedded coded data accordingto the Huffman table shown in FIG. 6 (pixel values obtained by decodingthe embedded coded data according to the Huffman table used in obtainingthe coded data).

Referring to FIG. 8, for example, with regard to the seven pixel valuesfrom [12] to [18], if the embedded coded data is decoded according tothe Huffman table shown in FIG. 6, decoded pixel values as shown in FIG.9 are obtained. That is, letting pixel values obtained by decoding theembedded coded data according to the Huffman table used at the time ofencoding be referred to as embedded decoded pixel value, codes“110011001”, “110111010”, “110100001”, “110111111”, “010001010”,“11011000”, and “011101011” are variable-length decoded into embeddeddecoded pixel values [15], [13], [14], [12], [18], [16], and [17],respectively.

FIG. 9(B) shows counts of the frequencies of occurrence of the embeddeddecoded pixel values [12] to [18]. Since codes assigned to pixel values[12] to [18] in the Huffman table shown in FIG. 6 are modified as shownin FIGS. 7(B) and 7(C), the frequencies of occurrence of pixel values[12], [15], and [16] to [18] do not coincide with those shown in FIG.7(A), and more specifically, they coincide with the frequencies ofoccurrence of pixel values [15], [12], [18], [16], and [17] prior tovariable-length encoding, respectively.

However, since the frequencies of occurrence of original pixel values[12] to [18] (prior to variable-length encoding) and the frequencies ofoccurrence of pixel values [12] to [18] obtained by variable-lengthdecoding are supposed to respectively coincide with each other, it isunnatural (strange) if the frequencies of occurrence differ betweenprior to variable-length encoding and after variable-length decoding.

Accordingly, the pattern of assignment of codes (variable-length codes),having been modified based on the additional information, can berestored to the original pattern by comparing the frequencies ofoccurrence of the original pixel values shown in FIG. 7(A) with thefrequencies of occurrence of the embedded decoded pixel values shown inFIG. 9(B) and by detecting matching frequencies of occurrence. That is,the embedded coded data can be restored into the coded data encodedaccording to the Huffman table. Furthermore, the embedded additionalinformation can be decoded based on how the pattern of code assignmentis modified when the embedded coded data is restored into the codeddata, and also, the original pixel values can be obtained byvariable-length decoding the restored coded data.

More specifically, by comparing the frequencies of occurrence of theoriginal pixel values shown in FIG. 7(A) with the frequencies ofoccurrence of the embedded decoded pixel values shown in FIG. 9(B), thefrequencies of occurrence of the embedded decoded pixel values [15],[13], [14], [12], [17], [18], and [16] can be detected as coincidingwith the frequencies of occurrence of the original pixel values [12] to[18], respectively.

Thus, embedded coded data “110011001”, “110111010”, “110100001”,“110111111”, “010001010”, “11011000”, and “011101011”, from whichembedded decoded pixel values [15], [13], [14], [12], [17], [18], and[16] have been obtained, can be determined as having been codes“110111111”, “110111010”, “110100001”, “110011001”, “11011000”,“011101011”, and “010001010” assigned to the original pixel values [12]to [18] in the Huffman table shown in FIG. 6 prior to embedding of theadditional information.

Thus, by translating the embedded coded data so that the frequencies ofoccurrence of the original pixel values shown in FIG. 7(A) coincide withthe frequencies of occurrence of the embedded decoded pixel values shownin FIG. 9(B), as shown in FIG. 9(C), the coded data encoded according tothe Huffman table shown in FIG. 6 can be restored, and the additionalinformation can be decoded based on the association between the embeddedcoded data and the restored coded data. Furthermore, by variable-lengthdecoding the restored coded data, the original pixel values can beobtained, as shown in FIG. 9(D).

The embedded compression encoder 11 shown in FIG. 2 performs an embeddedcoding process that does not increase the amount of data and that allowsdecoding without overhead, as described above.

Now, an embedded coding process executed by the embedded compressionencoder 11 shown in FIG. 2 will be further described with reference to aflowchart shown in FIG. 10.

In step S1, the variable-length encoding unit 23 variable-length encodesthe pixel value of each pixel in a frame under consideration suppliedfrom the frame memory 21, outputting the resulting coded data to thecoding rule destroying unit 25. Furthermore, in the variable-lengthencoding in step S1, the variable-length encoding unit 23 (FIG. 3)outputs a frequency table created by the frequency table creation unit31 to the MUX 26 as information related to Huffman table, and alsooutputs a Huffman table created by the Huffman table creation unit 33 tothe translation table creation unit 24.

Then, in step S2, the translation table creation unit 24 modifies thepattern of assignment of codes having the same code length in Huffmantable supplied from the variable-length encoding unit 23, based on theadditional information supplied from the additional information memory22, and executes a translation table creation process for creating atranslation table associating the codes prior to the modification withcodes after the modification. The translation table is supplied from thetranslation table creation unit 24 to the coding rule destroying unit25.

In step S3, the coding rule destroying unit 25 executes a coded datatranslation process for translating the coded data supplied from thevariable-length encoding unit 23 into embedded coded data according tothe translation table supplied from the translation table creation unit24, supplying the resulting embedded coded data to the MUX 26.

In step S4, the MUX 26 multiplexes and outputs the embedded coded dataof the frame under consideration, supplied from the coding ruledestroying unit 25, and the information related to Huffman table,supplied from the variable-length encoding unit 23. The process thenproceeds to step S5.

In step S5, it is determined whether a frame next to the frame underconsideration is stored in the frame memory 21. If it is determined instep S5 that a next frame is stored in the frame memory 21, with thenext frame a new frame to be considered, the process returns to step S1,repeating the same process.

If it is determined in step S5 that a next frame is not stored in theframe memory 21, the embedded coding process is exited.

Now, the translation table creation process executed in step S2 shown inFIG. 10 by the translation table creation unit 24 shown in FIG. 2 willbe further described with reference to a flowchart shown in FIG. 11.

In the translation table creation process, initially, in step S11, thetranslation table creation unit 24 considers a particular code length ofcodes in the Huffman table supplied from the variable-length encodingunit 23, recognizing the number of codes having the code length underconsideration. That is, the translation table creation unit 24recognizes the number of codes having the same code length as the codelength under consideration.

In step S12, the translation table creation unit 24 calculates thenumber of bits of additional information that can be embedded in thecodes having the code length under consideration, based on the number ofcodes having the code length under consideration, recognized in stepS11. That is, letting the number of codes having the code length underconsideration be denoted by x, the translation table creation unit 24obtains the number of bits y of additional information that can beembedded, by calculating y=int[log₂(X!)].

The process then proceeds to step S13, in which the translation tablecreation unit 24 reads the additional information for the number of bitsy, calculated in step S12, from the additional information memory 22.The process then proceeds to step S14. In step S14, the translationtable creation unit 24 creates a translation table for the codes havingthe code length under consideration, based on the additional informationread from the additional information memory 22 in step S13. That is, thetranslation table creation unit 24 modifies the pattern of assignment ofx codes having the code length under consideration to pixel values,based on the y-bit additional information, thereby creating atranslation table for the codes having the code length underconsideration, in which the codes prior to the modification areassociated with codes after the modification.

Then, in step S15, the translation table creation unit 24 determineswhether further additional information is stored in the additionalinformation memory 22. If it is determined that none is stored, thetranslation table creation unit 24 outputs translation tables created sofar for the frame under consideration to the coding rule destroying unit25 (FIG. 2). The translation table creation process is then exited.

If it is determined in step S15 that further additional information isstored in the additional information memory 22, the process proceeds tostep S16, in which the translation table creation unit 24 determineswhether a translation table has been created for codes of each codelength in the Huffman table. If it is determined that the creation isnot complete, the process returns to step S11. In this case, in stepS11, one of the code lengths for which a translation table has not beencreated is selected as a new code length to be considered, and then thesame process is repeated.

If it is determined in step S16 that a translation table has beencreated for codes of each code length in the Huffman table, thetranslation table creation process is exited.

Next, the coded data translation process executed in step S3 shown inFIG. 10 by the coding rule destroying unit 25 shown in FIG. 2 will befurther described with reference to a flowchart shown in FIG. 12.

As described above, the variable-length encoding unit 23 considers eachpixel in the frame under consideration in order of raster scanning, andvariable-length encodes the pixel value of the pixel underconsideration, sequentially outputting the resulting coded data. Lettingthe coded data output for the pixel under consideration by thevariable-length encoding unit 23 be referred to as coded data underconsideration, initially, in step S21, the coding rule destroying unit25 recognizes the code length of the coded data under consideration. Theprocess then proceeds to step S22.

In step S22, the coding rule destroying unit 25 translates the codeddata under consideration according to the translation table associatedwith the code length of the coded data under consideration, recognizedin step S21, and outputs the result to the MUX 26 (FIG. 2) as embeddedcoded data.

The process then proceeds to step S23, in which the coding ruledestroying unit 25 determines whether next coded data supplied from thevariable-length encoding unit 23 exits. If it is determined that nextcoded data exists, the coding rule destroying unit 25 selects the nextcoded data as new coded data to be considered. The process then returnsto step S21, repeating the same process.

If it is determined in step S23 that next coded data does not exist, thecoded data translation process is exited.

The embedded compression encoder 11 shown in FIG. 2 yields embeddedcoded data, in which additional information is embedded, by translating,according to a translation table, coded data yielded by variable-lengthencoding in the variable-length encoding unit 23. Alternatively, forexample, the variable-length encoding unit 23 may create a Huffman tablein which the association of pixel values with codes is modified(hereinafter referred to as modified Huffman table when appropriate) anduse the modified Huffman table to simultaneously perform variable-lengthencoding and embedding of additional information. That is, thevariable-length encoding unit 23 may perform variable-length encodingbased on a destroyed coding rule.

FIG. 13 shows an example construction of the embedded compressionencoder 11 that executes such an embedded coding process. In the figure,parts corresponding to those shown in FIG. 2 or FIG. 3 are designated bythe same numerals, and descriptions thereof will hereinafter be omittedas appropriate. The embedded compression encoder 11 shown in FIG. 13does not include the coding rule destroying unit 25; instead, a codingrule destroying unit 41 is included in the variable-length encoding unit23. The embedded compression encoder 11 is otherwise constructed thesame as shown in FIG. 2.

To the coding rule destroying unit 41, a Huffman table output from theHuffman table creation unit 33 and a translation table output from thetranslation table creation unit 24 are supplied.

The coding rule destroying unit 41 modifies codes (coded data)associated with pixel values in the Huffman table into embedded codeddata associated with the codes in the translation table, therebymodifying the Huffman table supplied from the Huffman table creationunit 33 into a modified Huffman table in which the pixel values areassociated with the embedded coded data. The modified Huffman table issupplied to the encoding unit 34, which translates the pixel valuesaccording to the modified Huffman table.

Thus, in FIG. 13, the encoding unit 34 outputs the embedded coded data.

FIG. 14 shows an example construction of the decoder 12 shown in FIG. 1,in a case where the embedded compression encoder 11 is constructed asshown in FIG. 2 or FIG. 13.

A DEMUX (demultiplexer) 51 demultiplexes, on a frame basis, dataprovided from the embedded compression encoder 11 shown in FIG. 2 orFIG. 13 into embedded coded data and information related to Huffmantable, supplying the embedded coded data for each frame to avariable-length decoding unit 52 and to a coding rule restoring unit 55while supplying the information related to Huffman table to thevariable-length decoding unit 52, a reverse translation table creationunit 54, and to a variable-length decoding unit 56.

The variable-length decoding unit 52 sequentially considers each frameof the embedded coded data and the information related to Huffman tableoutput from the DEMUX 51, and creates a Huffman table based on afrequency table constituting the information related to Huffman tableassociated with the frame under consideration, in the same manner as inthe variable-length encoding unit 23 shown in FIG. 3, supplying it tothe reverse translation table creation unit 54.

The Huffman table created from the frequency table constituting theinformation related to Huffman table is the same one as that used forvariable-length encoding in the variable-length encoding unit 23, andwill hereinafter be referred to as a true Huffman table whenappropriate. The frequency table constituting the information related toHuffman table, used to obtain the true Huffman table, will hereinafterbe referred to as a true frequency table when appropriate.

The variable-length decoding unit 52 then variable-length decodes theembedded coded data of the frame under consideration according to thetrue Huffman table, and supplies the resulting decoded pixel values,that is, embedded decoded pixel values, to the Huffman table creationunit 53.

The Huffman table creation unit 53 creates a Huffman table forvariable-length encoding the embedded decoded pixel values of the frameunder consideration, supplied from the variable-length decoding unit 52,and supplies the Huffman table and the frequency table created in theprocess of creating the Huffman table to the reverse translation tablecreation unit 54.

The Huffman table created by the Huffman table creation unit 53 is usedfor variable-length encoding the embedded decoded pixel values (obtainedby variable-length decoding the embedded coded data according to thetrue Huffman table), and basically does not allow correct decoding ofcoded data. Thus, the Huffman table obtained from the embedded decodedpixel values will hereinafter be referred to as a false Huffman tablewhen appropriate, as opposed to the true Huffman table. The frequencytable used for obtaining the false Huffman table will hereinafter bereferred to as a false frequency table when appropriate, as opposed tothe true frequency table.

The reverse translation table creation unit 54 creates a reversetranslation table for translating the embedded coded data into theoriginal coded data, based on the true Huffman table supplied from thevariable-length decoding unit 52, the true frequency table constitutingthe information related to Huffman table, supplied from the DEMUX 51,and the false Huffman table and the false frequency table supplied fromthe Huffman table creation unit 53. That is, the reverse translationtable creation unit 54 creates the same reverse translation table as thetranslation table created by the translation table creation unit 24shown in FIG. 2 (or FIG. 13). The reverse translation table is suppliedto the coding rule restoring unit 55.

The coding rule restoring unit 55 restores (decodes) the embedded codeddata supplied from the DEMUX 51 into the coded data encoded according tothe true Huffman table constituting the coding rule, according to thereverse translation table supplied from the reverse translation tablecreation unit 54. Furthermore, the coding rule restoring unit 55 decodesthe additional information embedded in the embedded coded data, based onthe association between the embedded coded data and the restored codeddata, that is, the reverse translation table. The coding rule restoringunit 55 outputs the restored coded data to the variable-length decodingunit 56 and also outputs the additional information that has beendecoded as decoded additional information.

The variable-length decoding unit 56 creates a true Huffman table fromthe information related to Huffman table supplied from the DEMUX 51, andvariable-length decodes the coded data supplied from the coding rulerestoring unit 55 based on the true Huffman table, outputting theresulting decoded pixel values.

FIG. 15 shows an example construction of the variable-length decodingunit 52 shown in FIG. 14.

The embedded coded data output from the DEMUX 51 is supplied to adecoding unit 63, and the frequency table constituting the informationrelated to Huffman table, output from the DEMUX 51, is supplied to aHuffman tree creation unit 61.

The Huffman tree creation unit 61 creates a Huffman tree from thefrequency table associated with the frame under consideration, andsupplies it to a Huffman table creation unit 62, similarly to theHuffman tree creation unit 32 shown in FIG. 3.

The Huffman table creation unit 62 creates a Huffman table based on theHuffman tree supplied from the Huffman tree creation unit 61, andsupplies it to the decoding unit 63, similarly to the Huffman tablecreation unit 33 shown in FIG. 3.

The decoding unit 63 decodes the embedded coded data supplied theretointo pixel values (embedded decoded pixel values) according to theHuffman table supplied from the Huffman table creation unit 62, andoutputs the result.

The variable-length decoding unit 56 shown in FIG. 14 is constructed thesame as the variable-length decoding unit 52 shown in FIG. 15.

FIG. 16 shows an example construction of the Huffman table creation unit53 shown in FIG. 14.

In the Huffman table creation unit 53, the embedded decoded pixel valuesoutput from the variable-length decoding unit 52 are supplied to afrequency table 71. The frequency table 71, a Huffman tree creation unit72, and a Huffman table creation unit 73 executes similar processes asthe frequency table creation unit 31, the Huffman tree creation unit 32,and the Huffman table creation unit 33 shown in FIG. 3, respectively.

Thus, the frequency table creation unit 71 creates a false frequencytable, that is, a frequency table for the embedded decoded pixel valuesof the frame under consideration (not a frequency table for the originalpixel values), which is supplied to the reverse translation tablecreation unit 54 (FIG. 14). The Huffman table creation unit 73 creates afalse Huffman table, that is, a Huffman table for translating theembedded decoded pixel values of the frame under consideration intocodes having code lengths in accordance with the frequencies ofoccurrence thereof (not a Huffman table for the original pixel values),which is supplied to the reverse translation table creation unit 54.

FIG. 17 shows an example construction of the reverse translation tablecreation unit 54 shown in FIG. 14.

As described above, to the reverse translation table creation unit 54,the true Huffman table, the true frequency table, the false Huffmantable, and the false frequency table are supplied. Based on thesetables, the reverse translation table creation unit 54 recognizes theassociation between the embedded coded data and coded data encodedaccording to the true Huffman table, and creates a reverse translationtable defining the association, as described with reference to FIGS. 6to 9.

The true Huffman table and the false Huffman table are supplied to acode association unit 82, while the true frequency table and the falsefrequency table are supplied to a comparison unit 81.

The comparison unit 81 compares the true frequency table with the falsefrequency table to detect, for each code length, pixel values of thesame frequency of occurrence in the true frequency table and the falsefrequency table. Furthermore, the comparison unit 81 creates a pixelvalue association table in which the pixel values of the same frequencyin the true frequency table and the false frequency table are associatedwith each other, and supplies it to the code association unit 82.

The code association unit 82 searches the true Huffman table and thefalse Huffman table for the pixel values associated with each other inthe pixel value association table supplied from the comparison unit 81,and associates codes respectively associated with the pixel values witheach other, thereby creating a reverse translation table. The reversetranslation table is supplied to the coding rule restoring unit 55.

Now, a decoding process executed by the decoder 12 shown in FIG. 14 willbe described with reference to a flowchart shown in FIG. 18.

The DEMUX 51 demultiplexes data supplied thereto into embedded codeddata and information related to Huffman table, supplying the embeddedcoded data for each frame to the variable-length decoding unit 52 and tothe coding rule restoring unit 55 while supplying the informationrelated to Huffman table to the variable-length decoding unit 52, thereverse translation table creation unit 54, and to the variable-lengthdecoding unit 56.

In step S31, the variable-length decoding unit 52 sequentially considerseach frame of the embedded coded data and the information related toHuffman table output from the DEMUX 51, and variable-length decodes theembedded coded data of the frame under consideration.

More specifically, the variable-length decoding unit 52 creates aHuffman table (true Huffman table) from a frequency table (truefrequency table) constituting the information related to Huffman tableof the frame under consideration, and supplies it to the reversetranslation table creation unit 54. Furthermore, the variable-lengthdecoding unit 52 variable-length decodes the embedded coded data of theframe under consideration according to the true Huffman table, andsupplies the resulting embedded decoded pixel values to the Huffmantable creation unit 53.

The process then proceeds to step S32, in which the Huffman tablecreation unit 53 creates a frequency table (false frequency table) fromthe embedded decoded pixel values of the frame under consideration,supplied from the variable-length decoding unit 52, and further createsa false Huffman table from the false frequency table. The falsefrequency table and the false Huffman table are supplied to the reversetranslation table creation unit 54.

In step S33, the reverse translation table creation unit 54 creates areverse translation table based on the true Huffman table, the truefrequency table constituting the information related to Huffman table,the false Huffman table, and the false frequency table, as describedwith reference to FIG. 17, and supplies it to the coding rule restoringunit 55.

In step S34, the coding rule restoring unit 55 decodes the additionalinformation embedded in the embedded coded data, by referencing theassociation between the embedded coded data and coded data of each codelength in the reverse translation table supplied from the reversetranslation table creation unit 54, and outputs the resulting decodedadditional information.

Furthermore, in step S35, the coding rule restoring unit 55 translatesthe embedded coded data supplied from the DEMUX 51 into coded data byreferencing the reverse translation table, and supplies it to thevariable-length decoding unit 56.

The variable-length decoding unit 56 creates a true Huffman table fromthe information related to Huffman table supplied from the DEMUX 51, andvariable-length decodes the coded data supplied from the coding rulerestoring unit 55 based on the true Huffman table, outputting theresulting decoded pixel values.

The process then proceeds to step S37, in which it is determined whetherembedded coded data and information related to Huffman table for a nextframe has been output from the DEMUX 51. If it is determined that theyhave been output, with the next frame a new frame to be considered, theprocess returns to step S31, repeating the same process.

If it is determined in step S37 that embedded coded data and informationrelated to Huffman table for a next frame have not been output from theDEMUX 51, the decoding process is exited.

As described earlier, instead of the frequency table, the Huffman tableitself may be used as the information related to Huffman table. In thatcase, however, the Huffman table constituting the information related toHuffman table must be created such that the frequencies of occurrence ofpixel values to which codes (coded data) of the same length are assignedcan be recognized as being higher or lower relative to each other byreferencing the Huffman table (according to a rule that allows suchrecognition).

Furthermore, although Huffman tables are created on a frame basis in theexample described above, alternatively, Huffman tables may be created,for example, on a field basis, or on a basis of two or more frames.

Furthermore, Huffman tables may be created in advance, for example,using a predetermined image data, so that the embedded compressionencoder 11 and the decoder 12 execute processes according to the Huffmantables created in advance. In that case, however, if Huffman tablescreated from image data to be processed do not coincide with the Huffmantables created from the predetermined image data, the decoder 12 willnot be able to restore embedded coded data into coded data. Thus,additional information to be embedded must be limited only to such imagedata from which the same Huffman tables as those created from thepredetermined image data can be obtained.

FIG. 19 shows another example construction of the embedded compressionencoder 11 shown in FIG. 1.

To an encoding unit 91, image data to be encoded is supplied. Theencoding unit 91 encodes the image data according to a predeterminedcoding rule, outputting the resulting coded data to an embedding unit92.

To the embedding unit 92, additional information is supplied. Theembedding unit 92 manipulates the coded data supplied from the encodingunit 91 based on the additional information to obtain coded data encodedaccording to a destroyed coding rule, thereby embedding the additionalinformation in the coded data.

Now, a process executed by the embedded compression encoder 11 shown inFIG. 19 (embedded coding process) will be described with reference to aflowchart shown in FIG. 20.

To the encoding unit 91, image data to be encoded is supplied, forexample, on a frame basis. The encoding unit 91 sequentially considerseach frame, and in step S41, it encodes image data of the frame underconsideration according to a predetermined coding rule. The encodingunit 91 then outputs the resulting coded data to the embedding unit 92.

In step S42, the embedding unit 92 modifies or destroys the coding rulein the encoding unit 91 based on the additional information, therebyembedding the additional information. That is, the embedding unit 92manipulates the coded data supplied from the encoding unit 91 based onthe additional information, thereby embedding the additional informationin the coded data. Furthermore, the embedding unit outputs embeddedcoded data obtained by embedding the additional information in the codeddata. The process then proceeds to step S43.

In step S43, the encoding unit 91 determines whether a next frame to beencoded exists. If it is determined that a next frame exists, with thenext frame as a new frame to be considered, the process returns to stepS41, repeating the same process.

If it is determined in step S43 that no further frame exists to beencoded next, the embedded coding process is exited.

FIG. 21 shows an example construction of the encoding unit 91 shown inFIG. 19.

In the encoding unit 91 shown in FIG. 21, for example, if the pixelvalues constituting image data are represented in RGB (Red, Green, andBlue), each of the pixel values is vector-quantized in the RGB colorspace, and a code representing a centroid vector (hereinafter referredto as VQ code when appropriate), an error of the pixel value representedby the centroid vector corresponding to the code relative to theoriginal pixel value (hereinafter referred to as VQ residual whenappropriate), and a codebook used for the vector quantization are outputas coded data.

More specifically, image data to be encoded is supplied to a framememory 101, and the frame memory 101 sequentially stores image datasupplied thereto, for example, on a frame basis.

A codebook creation unit 102 sequentially considers each frame of theimage data stored in the frame memory 101, and creates a codebook to beused for vector quantization in the color space from the pixel value ofeach of the pixels constituting the frame under consideration, forexample, by what is called the LBG algorithm. The codebook is suppliedto a vector quantization unit 103, and is output as (part of) codeddata.

The vector quantization unit 103 reads the frame under considerationfrom the frame memory 101, and sequentially considers each of the pixelsconstituting the frame under consideration, for example, in order ofraster scanning. The vector quantization unit 103 vector-quantizes thepixel value of the pixel under consideration using the codebook suppliedfrom the codebook creation unit 102, outputting the resulting VQ codeand VQ residual as (part of) coded data.

As shown in FIG. 22, in the encoding unit 91 constructed as describedabove, the codebook creation unit 102 creates a codebook from the pixelvalue of each of the pixels constituting the frame under consideration,which is supplied to the vector quantization unit 103. The vectorquantization unit 103 vector-quantizes the pixel value of a pixel underconsideration using the codebook supplied from the codebook creationunit 102.

That is, the vector quantization unit 103 detects, from the codebook, acentroid vector representing a point with the shortest distance to thepoint on the RGB space represented by the pixel value of the pixel underconsideration, outputting a VQ code representing the centroid vector.Furthermore, the vector quantization unit 103 calculates the differencebetween the centroid vector represented by the VQ code and the vectorcorresponding to the point on the RGB space represented by the pixelvalue of the pixel under consideration, outputting the resultingdifference vector as VQ residual.

The encoding unit 91 then outputs the codebook, and the VQ code and VQresidual for each of the pixels in the frame under consideration, thusobtained, as coded data associated with the frame under consideration.

FIG. 23 shows an example construction of the embedding unit 92 shown inFIG. 19, in a case where the encoding unit 91 is constructed as shown inFIG. 21.

The VQ code, VQ residual, and the codebook of the frame underconsideration, output from the encoding unit 91, are supplied to andstored in a VQ code memory 111, a VQ residual memory 112, and a codebookmemory 113, respectively.

The VQ code and the codebook stored respectively in the VQ code memory111 and the codebook memory 113 are read therefrom, and supplied to acompression unit 115.

A line rotation unit 114 sequentially considers each line in the frameunder consideration, for example, from top to bottom, and reads the VQresidual of the line under consideration stored in the VQ residualmemory 112. Furthermore, letting the number of pixels constituting theline under consideration be denoted by x, the line rotation unit 114receives additional information of the number of bits represented byint[log₂x], and, for example, as shown in FIG. 24, rotates the VQresidual of the line under consideration to the right for the number ofbits corresponding to the additional information, thereby embedding theadditional information in the line under consideration. That is, withregard to a pixel on the line under consideration, the line rotationbasically changes the VQ residual for the pixel from that obtained bythe vector quantization, that is, the coding rule for the vectorquantization is modified or destroyed. By destroying the coding rule,the additional information is embedded.

Then, the line rotation unit 114 supplies the VQ residual of the lineunder consideration with the additional information embedded therein tothe compression unit 115.

The compression unit 115 compresses the VQ code, VQ residual, andcodebook supplied thereto, for example, based on spatial correlation orbias of entropy, and outputs the results of the compression to a MUX116. The MUX 116 multiplexes the compressed VQ code, VQ residual, andcodebook for output.

Now, a process executed by the embedded compression encoder 11 shown inFIG. 19 (embedded coding process), in a case where the encoding unit 91is constructed as shown in FIG. 21 and the embedding unit 92 isconstructed as shown in FIG. 23, will be described with reference to aflowchart shown in FIG. 25.

In the encoding unit 91 (FIG. 21), a predetermined frame stored in theframe memory 101 is considered, and in step S51, each pixel in the frameunder consideration is encoded by vector quantization, as describedearlier. The VQ code, VQ residual, and codebook, constituting the codeddata obtained by vector-quantizing the frame under consideration, aresupplied to the embedding unit 92.

In the embedding unit 92 (FIG. 23), the VQ code, VQ residual, andcodebook associated with the frame under consideration, supplied fromthe encoding unit 91, are supplied to and stored in the VQ code memory111, the VQ residual memory 112, and the codebook memory 113,respectively. In step S52, the line rotation unit 114 determines whetherall the lines of the frame under consideration for which a VQ residualis stored in the VQ residual memory 112 have been processed.

If it is determined in step S52 that all the lines of the frame underconsideration for which a VQ residual is stored in the VQ residualmemory 112 have not been processed yet, the line rotation unit 114selects the uppermost one of the lines yet to be processed in the frameunder consideration as a new line to be considered. The process thenproceeds to step S53.

In step S53, the line rotation unit 114 rotates each of the pixels inthe line under consideration, having VQ residuals as pixel values, tothe right for the number of pixels corresponding to the additionalinformation, thereby embedding the additional information in the lineunder consideration, and supplies the result to the compression unit115. The process then returns to step S52, repeating the same process.

If it is determined in step S52 that all the lines of the frame underconsideration for which a residual is stored in the VQ residual memory112 have been processed, the process proceeds to step S54, in which thecompression unit 115 reads the VQ code of the frame under considerationstored in the VQ code memory 111, and also reads the codebook for theframe under consideration stored in the codebook memory 113. In stepS54, the compression unit 115 compresses the VQ code and the codebook,and the VQ residual with the additional information embedded therein,supplied from the line rotation unit 114, and supplies the results tothe MUX 116.

In step S55, the MUX 116 multiplexes the VQ code, VQ residual, andcodebook supplied from the compression unit 115 for output. The processthen proceeds to step S56.

In step S56, it is determined whether a next frame to be encoded in theencoding unit 91 exists. If it is determined that a next frame exists,with the next frame to be encoded as a new frame to be considered, theprocess returns to step S51, repeating the same process.

If it is determined in step S56 that no further frame exists to beencoded next, the embedded coding process is exited.

FIG. 26 shows an example construction of the decoder 12 shown in FIG. 1,in a case where the embedded compression encoder 11 is constructed asshown in FIG. 19.

The embedded coded data output from the embedding unit 92 shown in FIG.19 is supplied to a coding rule restoring unit 121.

The coding rule restoring unit 121 restores (decodes) the embedded codeddata into the coded data encoded according to the coding rule in theencoding unit 91 shown in FIG. 19, thereby decoding the additionalinformation embedded in the embedded coded data.

That is, the coding rule restoring unit 121 manipulates the embeddedcoded data based on a parameter supplied from a parameter controller124, thereby obtaining a candidate of the coded data (hereinafterreferred to as tentative coded data when appropriate). Furthermore, thecoding rule restoring unit 121 obtains a candidate of the additionalinformation (hereinafter referred to as tentative decoded additionalinformation) embedded in the embedded coded data, based on an operationfor restoring the embedded coded data into the tentative coded data. Thetentative coded data is supplied to a decoding unit 122 and to adetermination unit 123, while the tentative decoded additionalinformation is supplied to the determination unit 123.

The decoding unit 122 performs a decoding operation upon the tentativecoded data supplied from the coding rule restoring unit 121, based onthe coding rule in the encoding unit 91 shown in FIG. 19, therebyobtaining a candidate of the original pixel value (hereinafter referredto as tentative decoded pixel value when appropriate). The tentativedecoded pixel value is supplied to the determination unit 123.

The determination unit 123 controls the parameter controller 124 tosupply one or more parameter values to the coding rule restoring unit121, and determines a correct tentative decoded pixel value (coincidingwith the original pixel value) from one or more the tentative decodedpixel values obtained respectively in accordance with the one or moreparameter values. Furthermore, the determination unit 123 selects, fromone or more tentative decoded additional information supplied from thecoding rule restoring unit 121 respectively in association with the oneor more tentative decoded pixel values, the tentative decoded additionalinformation associated with the correct decoded pixel value as correctdecoded additional information, outputting the correct decoded pixelvalue and the tentative decoded additional information as the finalresults of decoding of pixel value and additional information (decodedpixel value and decoded additional information), respectively.

The parameter controller 124, under the control of the determinationunit 123, supplies a parameter for manipulating the embedded coded datato the coding rule restoring unit 121.

Now, a process executed by the decoder 12 shown in FIG. 26 (decodingprocess) will be described with reference to a flowchart shown in FIG.27.

Initially, in step S61, the determination unit 123 controls theparameter controller 124 to set a parameter to be supplied to the codingrule restoring unit 121. Accordingly, the parameter controller 126supplies a parameter, in accordance with the control by thedetermination unit 123, to the coding rule restoring unit 121.

In step S62, the coding rule restoring unit 121 manipulates the embeddedcoded data based on the parameter supplied from the parameter controller124, translating it into the tentative coded data, and supplies thetentative coded data to the decoding unit 122 and to the determinationunit 123. Furthermore, the coding rule restoring unit 121, based on theoperation for restoring the embedded coded data into tentative codeddata, that is, the parameter supplied from the parameter controller 124,decodes the additional information embedded in the embedded coded, andsupplies the result to the determination unit 123 as tentative decodedadditional information.

In step S63, the decoding unit 122 decodes the tentative coded datasupplied from the coding rule restoring unit 121 based on the codingrule in the encoding unit 91 shown in FIG. 19, and supplies theresulting pixel value to the determination unit 123 as tentative decodedpixel value.

In step S64, the determination unit 123 determines whether the tentativedecoded pixel value supplied from the decoding unit 122 is a correctdecoding result (coinciding with the original pixel value). If it isdetermined as not coinciding, the process returns to step S61. In thiscase, in step S61, the determination unit 123 sets a new value as aparameter to be output from the parameter controller 124, and the sameprocess is repeated.

If it is determined in step S64 that the tentative decoded pixel valueis a correct decoding result, the process proceeds to step S65, in whichthe determination unit 123 outputs the tentative decoded pixel value asdecoded pixel value constituting the result of decoding of the originalpixel value. Furthermore, the determination unit 123 outputs thetentative decoded additional information associated with the decodedpixel value, as decoded additional information constituting the resultof decoding of the additional information embedded. The process thenproceeds to step S66.

In step S66, it is determined whether further embedded coded data to bedecoded is remaining. If it is determined as remaining, the processreturns to step S61, repeating the same process for the embedded codeddata to be decoded.

If it is determined in step S66 that further embedded coded data to bedecoded does not exist, the decoding process is exited.

FIG. 28 shows an example construction of the coding rule restoring unit121 shown in FIG. 26, in a case where the embedding unit 92 shown inFIG. 19 is constructed as shown in FIG. 23.

Data output from the MUX 116 shown in FIG. 23 is supplied to a DEMUX131. The DEMUX 131 demultiplexes the data supplied thereto intocompressed VQ code, VQ residual, and codebook, and supplies them to anexpansion unit 132. The expansion unit 132 expands the compressed VQcode, VQ residual, and codebook supplied from the DEMUX 131, andsupplies the expanded VQ code, VQ residual, and codebook to a VQ codememory 133, a VQ residual memory 134, and to a codebook memory 135,respectively.

The VQ code memory 133, the VQ residual memory 134, and the codebookmemory 135 store, on a frame basis, the VQ code, VQ residual, andcodebook supplied from the expansion unit 132, respectively.

A line rotation unit 136 sequentially considers each line of the framestored in the VQ residual memory 134, for example, from top to bottom,and reads the VQ residual of the line under consideration stored in theVQ residual memory 134. Furthermore, letting the number of pixelsconstituting the line under consideration be denoted by x, the linerotation unit 136 receives an integer in a range of zero to x as aparameter from the parameter controller 124 (FIG. 26), and rotates theVQ residual of the line under consideration to the left for the numberof pixels corresponding to the parameter. The line rotation unit 136outputs the VQ residual of each line after the rotation as tentativecoded data, together with the VQ code stored in the VQ code memory 133and the codebook stored in the codebook memory 135.

Furthermore, the line rotation unit 136 outputs the parameter valuesupplied from the parameter controller 124 as tentative decodedadditional information.

FIG. 29 shows an example construction of the decoding unit 122 shown inFIG. 26, in a case where the encoding unit 91 shown in FIG. 19 isconstructed as shown in FIG. 21.

The decoding unit 122 decodes pixel values by inverse vectorquantization based on the VQ code, VQ residual, and codebook of a frame,constituting the coded data supplied from the coding rule restoring unit121.

That is, to an inverse vector quantization unit 141, the VQ code andcodebook are supplied. The inverse vector quantization unit 141 detectsa centroid vector corresponding to the VQ code from the codebook, andsupplies the centroid vector to an addition unit 142. To the additionunit 142, as well as the centroid vector supplied from the inversevector quantization unit 141, a difference vector constituting the VQresidual is also supplied. The addition unit 142 adds the centroidvector and the difference vector. The addition unit 142 outputs pixelvalues having the components of the vector obtained by the addition asthe R, G, and B values as tentative decoded pixel value.

FIG. 30 shows an example construction of the determination unit 123shown in FIG. 26, in a case where the coding rule restoring unit 121 andthe decoding unit 122 are constructed as shown in FIGS. 28 and 29,respectively.

To a memory 151, the tentative decoded additional information from thecoding rule restoring unit 121 and the tentative decoded pixel valuefrom the decoding unit 122 are supplied. The memory 151 temporarilystores the tentative decoded additional information and the tentativedecoded pixel value, and reads the tentative decoded additionalinformation and the tentative decoded pixel value under the control of atrue/false determination unit 154, outputting them as decoded additionalinformation and decoded pixel value, respectively.

To an encoding unit 152, the codebook included in the tentative codeddata output from the coding rule restoring unit 121 and the tentativedecoded pixel value output from the decoding unit 122 are supplied. Theencoding unit 152 encodes the tentative decoded pixel value similarly tothe encoding unit 91 shown in FIG. 19. That is, the encoding unit 152vector-quantizes the tentative decoded pixel value using the codebooksupplied from the coding rule restoring unit 121, supplying theresulting VQ code and VQ residual to a comparison unit 153. The VQ codeand VQ residual obtained by vector-quantizing the tentative decodedpixel value will hereinafter be referred to, when appropriate, astentative VQ code and tentative VQ residual, respectively.

To the comparison unit 153, as well as the tentative VQ code andtentative VQ residual output from the encoding unit 152, the VQ code andVQ residual included in the tentative coded data output from the codingrule restoring unit 121 are supplied. The comparison unit 153 comparesthe tentative VQ code with the VQ code in the tentative coded data, andalso compares the tentative VQ residual with the VQ residual in thetentative coded data, supplying the results of the comparisons to thetrue/false determination unit 154.

The true/false determination unit 154 controls the parameter controller124 to supply the number of bits for line rotation to the coding rulerestoring unit 121 as a parameter. Furthermore, the true/falsedetermination unit 154 determines whether the tentative decoded pixelvalue is a correct decoding result based on the result of the comparisonof the tentative VQ code and the VQ code in the tentative coded data,and the result of the comparison of the tentative VQ residual and the VQresidual in the tentative coded data, supplied from the comparison unit153, and controls reading of the tentative decoded pixel value and thetentative decoded additional information from the memory 151 based onthe result of the determination.

Now, the principle of determination by the true/false determination unit154 shown in FIG. 30 as to whether the tentative decoded pixel value isa correct decoding result will be described with reference to FIG. 31.

Since the encoding unit 91 (FIG. 19) performs vector quantization in theRGB space, a centroid vector used in the vector quantization is composedof three components, namely, R, B, and G components. Letting thecentroid vector composed of the R, B, and G components be denoted as (R,G, B), and assuming that each of the R, B, and G components of thecentroid vector in the codebook is represented by a multiple of ten forsimplicity of description, for example, a pixel value with R, B, and Gcomponents of 102, 103, and 99, respectively, (hereinafter denoted aspixel value (102, 103, 99) when appropriate) has the shortest distancerelative to a centroid vector (100, 100, 100), and thus isvector-quantized into a VQ code associated with the centroid vector(100, 100, 100). For example, let the VQ code associated with thecentroid vector (100, 100, 100) be 0.

In this case, subtracting the centroid vector (100, 100, 100) from thepixel value (102, 103, 99) yields the VQ residual (2, 3, −1). Thus, thepixel value (102, 103, 99) is encoded into the VQ code 0 and the VQresidual (2, 3, −1).

By inversely vector-quantizing the VQ code 0 and the VQ residual (2, 3,−1), constituting the coded data obtained in the encoding unit 91, asshown in FIG. 31(A), the centroid vector (100, 100, 100) associated withthe VQ code 0 and the VQ residual (2, 3, −1) are added to yield thepixel value (102, 103, 99), and thus correctly decoded to obtain theoriginal pixel value.

Furthermore, by vector-quantizing the decoded pixel value (102, 103, 99)again, as shown in FIG. 31(A), the VQ code 0 and the VQ residual (2, 3,−1) are obtained again.

From the above, by decoding the VQ code and the VQ residual constitutingthe coded data to obtain correct decoding result, and re-encoding(vector quantization herein) the decoding result, the VQ code and the VQresidual obtained by the encoding coincide with the VQ code and the VQresidual constituting the coded data, respectively.

Of the VQ code 0 and VQ residual (2, 3, −1) constituting the coded dataobtained in the encoding unit 91, when additional information isembedded by applying line rotation on the VQ residual (2, 3, −1) in themanner described earlier, VQ residual obtained for a different pixel isassigned as VQ residual between the VQ code 0 and the pixel associatedwith the VQ residual (2, 3, −1). If, for example, the VQ residual of thedifferent pixel is (10, 11, 12) as shown in FIG. 31(B), by adding thecentroid vector (100, 100, 100) and the VQ residual (10, 11, 12), the VQcode 0 and the VQ residual (10, 11, 12) are decoded as the pixel value(110, 111, 112), and are not decoded correctly into the original pixelvalue (102, 103, 99).

Thus, even if the incorrect decoded pixel value (110, 111, 112) isvector-quantized again, the resulting VQ code and VQ residual do notcoincide with the VQ code 0 and the VQ residual (2, 3, −1) constitutingthe coded data, respectively, as shown in FIG. 31(B).

More specifically, in this case, since it is assumed that each of the R,B, and G components of a centroid vector in the codebook is representedby a multiple of ten, the centroid vector with the shortest distance tothe pixel value (110, 111, 112) is (110, 110, 110). Thus, for example,assuming that the VQ code representing the centroid vector (110, 110,110) is 1, the pixel value (110, 111, 112) is vector-quantized into theVQ code 1 and the VQ residual (0, 1, 2) (=(110, 111, 112)−(110, 110,110)). In this case, neither the VQ code nor the VQ residual coincideswith the VQ code or the VQ residual (10, 11, 12) constituting theoriginal coded data.

From the above, if the number of pixels for the rotation according tothe parameter in the line rotation unit 136 shown in FIG. 28 does notcoincide with the additional information, that is, if the tentativecoded data does not coincide with the coded data before the additionalinformation is embedded therein, VQ code and VQ residual obtained byre-encoding the tentative decoded pixel value obtained from thetentative coded data do not coincide respectively with the VQ code andthe VQ residual constituting the tentative coded data, and thus thetentative decoded pixel value obtained by decoding the tentative codeddata can be determined as incorrect decoding result.

On the other hand, if the number of pixels for the rotation according tothe parameter in the line rotation unit 136 shown in FIG. 28 coincideswith the additional information, that is, if the tentative coded datacoincides with the coded data before the additional information isembedded therein, VQ code and VQ residual obtained by re-encoding thetentative decoded pixel value obtained from the tentative coded datacoincide respectively with the VQ code and the VQ residual constitutingthe tentative coded data, and thus the tentative decoded pixel valueobtained by decoding the tentative coded data can be determined ascorrect decoding result.

Now, a decoding process executed by the decoder 12 shown in FIG. 26, ina case where the coding rule restoring unit 121, the decoding unit 122,and the determination unit 123 are constructed as shown in FIGS. 28 to30, respectively, will be described with reference to a flowchart shownin FIG. 32.

In the decoding process, the DEMUX 131 of the coding rule restoring unit121 demultiplexes data supplied thereto into compressed VQ code, VQresidual, and codebook, supplying them to the expansion unit 132. Instep S71, the expansion unit 132 expands the compressed VQ code, VQresidual, and codebook supplied from the DEMUX 131, supplying theexpanded VQ code, VQ residual, and codebook to and stores them in the VQcode memory 133, the VQ residual memory 134, and the codebook memory135, respectively.

Then, in step S72, the true/false determination unit 154 of thedetermination unit 123 (FIG. 30) controls the parameter controller 124(FIG. 26) to set a particular parameter value, and supplies theparameter to the coding rule restoring unit 121.

The true/false determination unit 154, for example, sequentially setsintegers in a range of zero to the number of pixels on one line as theparameter value, each time the process in step S72 is executed for eachline of each frame.

When the coding rule restoring unit 121 receives the parameter from theparameter controller 124, in step S73, the line rotation unit 136rotates the VQ residual of the line under consideration to the left forthe number of pixels corresponding to the parameter, supplying the VQresidual having been left-rotated, together with the VQ code of the lineunder consideration stored in the VQ code memory 133 and the codebookstored in the codebook memory 135, to the decoding unit 122 as tentativecoded data. Furthermore, the line rotation unit 136 supplies the numberof pixels for which the line under consideration is rotated to thedetermination unit 123 as tentative decoded additional information.

In step S74, the decoding unit 122 performs inverse vector quantizationbased on the VQ code, VQ residual, and codebook constituting thetentative coded data supplied from the coding rule restoring unit 121,thereby decoding the pixel values of the line under consideration, andsupplies the resulting tentative decoded pixel values to thedetermination unit 123.

In the determination unit 123 (FIG. 30), the tentative decodedadditional information output from the coding rule restoring unit 121and the tentative decoded pixel values output from the coding rulerestoring unit 121 are stored in the memory 151. Furthermore, in stepS75, in the determination unit 123, the encoding unit 152vector-quantizes the tentative decoded pixel values supplied from thedecoding unit 122, and supplies the resulting tentative VQ code andtentative VQ residual to the comparison unit 153.

The comparison unit 153 compares, for each pixel of the line underconsideration, the tentative VQ code supplied from the encoding unit 152with the VQ code constituting the tentative coded data, and alsocompares the tentative VQ residual supplied from the encoding unit 152with the VQ residual constituting the tentative coded data, supplyingthe results of the comparisons to the true/false determination unit 154.In step S76, the true/false determination unit 154 determines, for eachpixel of the line under consideration, whether the tentative VQ codecoincides with the VQ code constituting the tentative coded data, andwhether the tentative VQ residual coincides with the VQ residualconstituting the tentative coded data. If it is determined that one orneither do not coincide for one or more pixels, that is, if the value ofthe parameter set in the immediately preceding step S72 does notcoincide with the additional information, the process returns to stepS72, in which a new parameter value is set, and the same process isrepeated.

If it is determined in step S76 that the tentative VQ code coincideswith the VQ code constituting the tentative coded data and the tentativeVQ residual coincides with the VQ residual constituting the tentativecoded data for every pixel of the line under consideration, that is, ifthe parameter value set in the immediately preceding step S72 coincideswith the additional information and if the coded data has been restoredand the original additional information has been correctly decoded asthe tentative decoded additional information, the process proceeds tostep S77, in which the true/false determination unit 154 controls thememory 151 to output the tentative decoded pixel value and the tentativedecoded additional information of each pixel of the line underconsideration, stored therein, as correct decoded pixel value anddecoded additional information, respectively. The process then proceedsto step S78.

In step S78, it is determined whether a line to be decoded next exists.If it is determined that a next line exists, the process returns to stepS72, in which the same process is repeated with the next line to bedecoded as a new line to be considered.

If it is determined in step S78 that no line exists to be decoded next,the decoding process is exited.

The decoding process shown in FIG. 32 is executed for each frame.

As described above, a coding rule for obtaining coded data is destroyed(modified) based on additional information, and embedded coded dataencoded according to the destroyed coding rule is manipulated in apredetermined manner, whereby tentative coded data is obtained. Thetentative coded data is decoded, and it is determined whether encodingthe result of decoding yields the same data as the tentative coded data,so that coded data prior to destruction of the coding rule is restored(decoded). Accordingly, by utilizing the destruction and restoration ofthe coding rule, additional information can be embedded and decodedwithout increasing the amount of coded data.

The applicant has already proposed, in U.S. patent application Ser. No.09/636,138, a method for embedding additional information in an imagebased on, for example, correlation of images. According to the proposedmethod, for example, lines constituting a frame are exchanged based onadditional information, and the lines of the frame that have beenexchanged are restored to the original positions based on the fact thatadjacent lines in the original frame are highly correlated with eachother. Depending on cases, the method based on correlation has notalways been successful in embedding additional information. That is,simply put, the method based on correlation, with regard to a line of aframe in which additional information is embedded, exchanges a lineadjacent to the line with a line that is most highly correlated with theline under consideration, until all the lines are restored to originalpositions. However, in some images, a line that is most highlycorrelated with a line under consideration is not necessarily a line tobe positioned adjacent to the line under consideration. When such linesare exchanged by embedding additional information, the lines cannot berestored to original positions based on correlation, inhibitingadditional information from being embedded.

As opposed thereto, the method described earlier is not subject to sucha failure of decoding.

In the embodiment shown in FIG. 26, the decoder 12 includes only asingle line of the pair of the coding rule restoring unit 121 and thedecoding unit 122, sequentially obtaining tentative coded dataassociated with various parameter values by sequentially changingparameters output from the parameter controller 124; however, forexample, as shown in FIG. 33, the decoder 12 may include M lines ofcoding rule restoring units 121 ₁ to 121 _(M) and decoding units 122 ₁to 122 _(M), supplying different parameter values respectively to theeach coding rule restoring units 121 _(m) (m=1, 2, . . . , M) so thattentative coded data respectively associated with the parameter valuescan be simultaneously obtained.

Furthermore, although the encoding unit 91 shown in FIG. 19 performsvector quantization in the example described above, the encoding unit 91may perform, for example, predictive coding instead of vectorquantization. In that case, the embedding unit 92 is allowed to embedadditional information by manipulating prediction residual associatedwith predictive coding based on the additional information.

Furthermore, although additional information is embedded by rotating VQresidual of each line based on the additional information in the exampledescribed above, additional information may also be embedded, forexample, by rotating a bit sequence of a value representing the VQresidual.

Furthermore, although codebooks are created and included in coded dataon a frame basis in the example described above, codebooks may becreated in advance and stored in each of the embedded compressionencoder 11 and the decoder 12. Furthermore, codebooks may be created ona basis of a plurality of frames, or on a basis of a predetermined areaof a frame.

The series of processes described above may be implemented in hardwareor in software. When the series of processes is implemented in software,a program constituting the software is installed, for example, on ageneral-purpose computer.

FIG. 34 shows an example construction of a computer on which a programfor executing the series of processes described above is installed.

The program may be stored in advance in a recording medium incorporatedin the computer, such as a hard disc 205 or a ROM 203.

Alternatively, the program may be temporarily or permanently stored(recorded) on a removable storage medium 211 such as a floppy disk, aCD-ROM (Compact Disc Read Only Memory), an MO (Magneto optical) disc, aDVD (Digital Versatile Disc), a magnetic disc, or a semiconductormemory. The removable recording medium 211 can be provided in the formof what is called package software.

Instead of installing the program on the computer from the removablerecording medium 211 as described above, the program may be transferredby wireless to the computer from a downloading site via an artificialsatellite for digital satellite broadcasting, or may be transferred tothe computer by wired link via a network such as a LAN (Local AreaNetwork) or the Internet, so that the computer receives the program thustransferred via a communication unit 208 and then installs the programin an internal hard disc 205.

The computer includes a CPU (Central Processing Unit) 202. To the CPU202, an input/output interface 210 is connected via a bus 201. Inresponse to a command input via the input/output interface 210 by auser's operation on an input unit 207 including a keyboard, a mouse, amicrophone, etc., the CPU 202 executes a program stored in a ROM (ReadOnly Memory) 203 according to the command. Alternatively, the CPU 202loads a program stored in the hard disc 205, a program transferred via asatellite or a network, received via the communication unit 208, andinstalled on the hard disc 205, or a program read from the removablerecording medium 211 mounted on a drive 209 and installed on the harddisc 205, into a RAM (Random Access Memory) 204 for execution. The CPU202 thus executes processes according to the flowcharts described above,or processes executed by the constructions shown in the block diagramsdescribed above. The CPU 202, as required, outputs the results of theprocesses to an output unit 206 including an LCD (Liquid CrystalDisplay), a speaker, etc., transmits them via the communication unit208, records them on the hard disc 205, etc., for example, via theinput/output interface 210.

In this specification, the processing steps constituting programs forexecuting various processes on a computer need not necessarily beexecuted sequentially in the order shown in the flowcharts, and may beexecuted in parallel or individually (e.g., parallel processing orprocesses based on objects).

The program may be executed by a single computer or by distributedprocessing using a plurality of computers. Furthermore, the program maybe transferred to and executed on a remote computer.

Although image data is encoded in the embodiment, data to be encoded isnot limited to image data, and various data such as audio data andcomputer programs may be used.

INDUSTRIAL APPLICABILITY

According to the first data processing apparatus, data processingmethod, and storage medium of the present invention, first data isencoded to output coded data. Then, a portion of the coded data ismodified based on the second data so that the second data is embedded inthe coded data.

According to the second data processing apparatus, data processingmethod, and storage medium of the present invention, a coding table forencoding first data is created, and the coding table created is modifiedbased on second data to create a modified coding table. Then, the firstdata is encoded based on the modified coding table to generate embeddedcoded data in which the second data is embedded.

According to the fifth data processing apparatus, data processingmethod, and storage medium of the present invention, first data isencoded according to a coding rule to output coded data. Then, thecoding rule is modified based on second data, and the first data isencoded according to the modified coding rule to generate embedded codeddata in which the second data is embedded.

Thus, the second data can be embedded without increasing the amount ofdata.

According to the third data processing apparatus, data processingmethod, and storage medium of the present invention, embedded coded dataencoded by embedding second data in first data is tentatively decodedbased on a coding table to output tentative decoded data. Furthermore, atentative coding table is created based on the tentative decoded data,and the embedded coded data is decoded based on the coding table and thetentative coding table to obtain first decoded data. The coding table iscompared with the tentative coding table to obtain second decoded data.

According to the fourth data processing apparatus, data processingmethod, and storage medium of the present invention, a portion ofembedded coded data encoded by embedding second data in first data ismodified according to an input parameter, and tentatively decoded basedon a coding table to output tentative decoded data. Furthermore, thetentative decoded data is re-encoded to output re-encoded data. Theparameter is determined by comparing the embedded coded data and there-encoded data, and tentative decoded data obtained by tentativelydecoding, based on the coding table, the embedded coded data having beenpartially modified based on the parameter, is output as first decodeddata, and for second decoded data corresponding to the parameter is alsoobtained.

According to the sixth data processing apparatus, data processingmethod, and storage medium of the present invention, embedded coded dataobtained by embedding second data in first data is decoded to obtaincoded data encoded according to an entropy coding rule and to obtain thesecond data. Furthermore, the coded data is decoded to obtain the firstdata.

Thus, the first and the second data can be correctly decoded.

According to the data processing system of the present invention, in theencoding apparatus, first data is encoded according to a coding rule tooutput coded data. Then, the coding rule is modified based on seconddata, and the first data is encoded according to the modified codingrule to generate embedded data in which the second data is embedded. Inthe decoding apparatus, embedded coded data is decoded to obtain thecoded data encoded according to the coding rule and to obtain the seconddata. Then, the coded data is decoded to obtain the first data. Thus,the second data can be embedded without increasing the amount of codeddata obtained by encoding the first data. Furthermore, the data in whichthe second data is embedded can be correctly decoded to obtain the firstand the second data.

1. A data processing apparatus comprising: coding table creation meansfor statistically analyzing data values included in first data and forcreating a coding table for encoding the first data into coded databased on a result of the statistical analysis; coded data output meansfor generating and outputting coded data by encoding the first databased on the coding table created by said coding table creation means;and embedding means for embedding second data in the coded data outputfrom said coding table creation means by modifying a portion of thecoded data based on the second data.
 2. A data processing apparatusaccording to claim 1, wherein said embedding means comprises:translation table creation means for creating a translation table fortranslating coded data in the coding table created by said coding tablecreation means, based on the second data; and embedded coded datageneration means for translating the coded data output from said codeddata output means based on the translation table created by saidtranslation table creation means to generate embedded coded data inwhich the second data is embedded.
 3. A data processing apparatusaccording to claim 2, wherein said coding table creation meanscomprises: frequency table creation means for creating and outputting afrequency table representing the frequency of each data value includedin the first data; Huffman tree creation means for creating andoutputting a Huffman tree based on the frequency table output from saidthe frequency table creation means; and Huffman table creation means forcreating a Huffman table associating each of the data values with thecoded data, based on the Huffman tree created by said Huffman treecreation means; and said coded data output means generates and outputscoded data by encoding the first data based on the Huffman table createdby said Huffman table creation means.
 4. A data processing apparatusaccording to claim 3, wherein said translation table creation meanscomprises: pattern number detection means for detecting the number ofpatterns of coded data of each code length in the Huffman table createdby said Huffman table creation means; and information amount detectionmeans for detecting the amount of information that can be embedded incoded data of each code length in the Huffman table, based on the numberof patterns detected by said pattern number detection means; and saidtranslation table creation means creates and outputs a translation tablein which coded data of each code length in the Huffman table having beenmodified based on a portion of the second data in accordance with theamount of information detected by said information amount detectionmeans is associated with coded data of each code length prior to themodification.
 5. A data processing apparatus according to claim 4,wherein said embedded coded data generation means comprises code lengthdetection means for detecting the code length of coded data underconsideration in the coded data output from said coded data outputmeans; and said embedded coded data generation means translates thecoded data under consideration into embedded coded data for output basedon the translation table associated with the code length detected bysaid code length detection means.
 6. A data processing apparatusaccording to claim 1, wherein said coded data output means comprisesquantization means for outputting a quantization code generated byquantizing a data value included in the first data based on the codingtable, and a quantization error representing an error between thequantization code and the data value.
 7. A data processing apparatusaccording to claim 6, wherein said embedding means embeds the seconddata in the coded data output from said quantization means by modifyinga portion of the quantization error based on the second data.
 8. A dataprocessing apparatus according to claim 7, wherein said coding tablecreation means comprises codebook creation means for creating andoutputting a codebook including a vector quantization code representinga representative vector of a data value included in the first data; saidquantization means comprises vector quantization means forvector-quantizing each data value included in the first data based onthe codebook created by said codebook creation means to output a vectorquantization code, and for detecting and outputting a vectorquantization error representing the difference between the data valueand the representative vector represented by the vector quantizationcode; and said embedding means embeds the second data in the coded dataoutput from said vector quantization means by modifying a portion of thevector quantization error based on the second data.
 9. A data processingapparatus according to claim 7, wherein said embedding means embeds thesecond data in the coded data output from said quantization means byrotating a portion of the quantization error based on the second data.10. A data processing apparatus comprising: coding table creation meansfor statistically analyzing data values included in first data and forcreating a coding table for encoding the first data based on a result ofthe statistical analysis; modified coding table creation means formodifying the coding table created by said coding table creation meansbased on second data to create a modified coding table; and embeddedcoded data generation means for encoding the first data based on themodified coding table to generate embedded coded data in which thesecond data is embedded.
 11. A data processing apparatus according toclaim 10, wherein said modified coding table creation means comprisestranslation table creation means for creating a translation table fortranslating coded data in the coding table created by said coding tablecreation means based on the second data, and said modified coding tablecreation means creates a modified coding table by translating a portionof the coding table based on the translation table created by saidtranslation table creation means.
 12. A data processing apparatusaccording to claim 11, wherein said coding table creation meanscomprises: frequency table creation means for creating and outputting afrequency table representing a frequency of each data value included inthe first data; Huffman tree creation means for creating and outputtinga Huffman tree based on the frequency table output from said frequencytable creation means; and Huffman table creation means for creating aHuffman table associating each data value with the coded data, based onthe Huffman tree created by said Huffman tree creation means; and saidmodified coding table creation means creates a modified Huffman table bytranslating a portion of the Huffman table created by said Huffman tablecreation means.
 13. A data processing apparatus according to claim 12,wherein said translation table creation means comprises: pattern numberdetection means for detecting the number of patterns of coded data ofeach code length in the Huffman table created by said Huffman tablecreation means; and information amount detection means for detecting theamount of information that can be embedded in coded data of the codelength in the Huffman table, based on the number of patterns detected bysaid pattern number detection means; and said translation table creationmeans creates and outputs a translation table in which coded data ofeach code length in the Huffman table having been modified based on aportion of the second data in accordance with the amount of informationdetected by said information amount detection means is associated withcoded data of each code length prior to the modification.
 14. A dataprocessing apparatus according to claim 13, wherein said embedded codeddata generation means translates the first data into embedded coded datafor output based on the modified Huffman table created by said modifiedcoding table creation means.
 15. A data processing apparatus comprising:tentative decoding means for tentatively decoding embedded coded dataencoded by embedding second data in first data, based on a coding table,to output tentative decoded data; tentative coding table creation meansfor creating a tentative coding table based on the tentative decodeddata; first decoded data obtaining means for decoding the embedded codeddata based on the coding table and the tentative coding table to obtainfirst decoded data; and second decoded data obtaining means forobtaining second decoded data by comparing the coding table with thetentative coding table.
 16. A data processing apparatus according toclaim 15, wherein said tentative decoding means comprises: Huffman treecreation means for creating a Huffman tree based on a frequency tablethat is input together with the embedded coded data; and Huffman tablecreation means for creating a Huffman table associating a data value inthe first data with coded data, based on the Huffman tree created bysaid Huffman tree creation means; and said tentative decoding meansdecodes the embedded coded data based on the Huffman table to outputembedded decoded data.
 17. A data processing apparatus according toclaim 16, wherein said tentative coding table creation means comprises:further frequency table creation means for creating a further frequencytable representing the frequency of occurrence of each data value in theembedded decoded data based on the embedded decoded data; furtherHuffman tree creation means for creating a further Huffman tree based onthe further frequency table created by said further frequency tablecreation means; and further Huffman table creation means for creating afurther Huffman table associating a data value in the first data withembedded coded data, based on the further Huffman tree created by saidfurther Huffman tree creation means.
 18. A data processing apparatusaccording to claim 17 further comprising: comparison means for comparingthe frequencies in the frequency table and the further frequency tableto create a data value association table associating the same datavalues with each other; and translation table creation means forcreating a modified table associating coded data and embedded coded datarespectively associated with the data values associated with each otherby the data value association table created by said comparison means,based on the Huffman table and the further Huffman table; wherein saidsecond decoded data obtaining means obtains the second decoded databased on the association between the coded data and the embedded codeddata in the translation table.
 19. A data processing apparatus accordingto claim 18, wherein said first decoded data obtaining means comprisescoded data output means for translating the embedded coded data intocoded data based on the association between the coded data and theembedded coded data in the translation table, and for outputting thecoded data, and said first decoded data obtaining means decodes thecoded data output from said coded data output means based on the Huffmantable to obtain the first decoded data.
 20. A data processing apparatuscomprising: tentative decoding means for modifying a portion of embeddedcoded data encoded by embedding second data in first data according toan input parameter, and for tentatively decoding it based on a codingtable to output tentative decoded data; re-encoding means forre-encoding the tentative decoded data to output re-encoded data; anddecoding means for determining the parameter by comparing the embeddedcoded data and the re-encoded data, outputting tentative decoded data asfirst decoded data, obtained by tentatively decoding, based on thecoding table, the embedded coded data having been partially modified bysaid tentative decoding means based on the parameter, and for obtainingsecond decoded data corresponding to the parameter.
 21. A dataprocessing apparatus according to claim 20, wherein said tentativedecoding means modifies a quantization error of coded data includingquantization code and quantization error based on the parameter, andtentatively decodes the coded data based on a coding table to outputtentative decoded data.
 22. A data processing apparatus according toclaim 21, wherein said tentative decoding means rotates a portion of avector quantization error of coded data including vector quantizationcode and vector quantization error based on the parameter, andtentatively decodes it based on a codebook to output tentative decodeddata.
 23. A data processing apparatus according to claim 22, whereinsaid tentative decoding means comprises: inverse vector quantizationmeans for decoding the vector quantization code based on the codebook tooutput inverse vector quantization data; and addition means for addingthe rotated vector quantization error to the inverse vector quantizationdata output from said inverse vector quantization means to obtain thetentative decoded data.
 24. A data processing apparatus according toclaim 22, wherein said re-encoding means comprises re-vectorquantization means for performing vector quantization to detect, basedon the codebook, a tentative vector quantization code representing arepresentative vector that is most approximate to the tentative decodeddata, and for detecting a tentative vector quantization errorrepresenting the difference between the tentative decoded data and therepresentative vector represented by the vector quantization code.
 25. Adata processing apparatus according to claim 24, wherein said decodingmeans comprises comparison means for comparing the vector quantizationcode with the tentative vector quantization code and for comparing thevector quantization error and the tentative vector quantization error,and when the comparisons by said comparison means result in coincidence,said decoding means outputs second decoded data corresponding to theparameter representing the amount of movement by the rotation of thevector quantization error, and also outputs the tentative decoded dataas first decoded data, whereas when the comparisons do not result incoincidence, said decoding means modifies the parameter representing theamount of movement by the rotation of the vector quantization error, andsupplies it to said tentative decoding means.
 26. A data processingapparatus according to claim 20, comprising a plurality of saidtentative decoding means, to which different parameters are respectivelyinput, wherein said decoding means selects one of the plurality of saidtentative decoding means in accordance with the result of the comparisonbetween the embedded coded data and the re-encoded data, outputting thetentative decoded data output from the selected one of said tentativedecoding means as first decoded data, and also outputting second decodeddata corresponding to the parameter input to the selected one of saidtentative decoding means.
 27. A data processing apparatus comprising:encoding means for encoding first data according to a compression codingrule to output coded data; and modification means for modifying thecompression coding rule based on second data; wherein said encodingmeans encodes the first data according to the compression coding rulemodified by said modification means, thereby generating embedded codeddata in which the second data is embedded.
 28. A data processingapparatus according to claim 27, wherein said encoding means performsvariable-length encoding according to a coding rule in which each datavalue included in the first data is assigned a coded data having alength based on the frequency of occurrence of the data value.
 29. Adata processing apparatus according to claim 28, wherein saidmodification means modifies, based on the second data, coded dataassociated with data values to which coded data of the same length areassigned.
 30. A data processing apparatus according to claim 29, whereinsaid modification means modifies, based on the second data, coded dataassociated with data values to which coded data of the same length areassigned in a coding table associating each data value with coded datato be assigned to the data value based on the frequency of occurrence ofeach data value in the first data, thereby modifying the coding table tocreate a modified table, and said encoding means generates embeddedcoded data by encoding the first data according to the modified table.31. A data processing apparatus according to claim 27, wherein saidmodification means manipulates, based on the second data, a quantizationcode and a quantization error output by quantizing the first data, sothat the quantization code and the quantization error cause a mismatch,and said encoding means outputs the manipulated quantization code andquantization error as embedded coded data.
 32. A data processingapparatus according to claim 27, wherein the first data is image data.33. A data processing apparatus comprising: first decoding means fordecoding embedded coded data obtained by embedding second data in firstdata, to obtain coded data encoded according to an entropy coding ruleand to obtain the second data; and second decoding means for decodingthe coded data to obtain the first data.
 34. A data processing apparatusaccording to claim 33, wherein said first decoding means decodes theembedded coded data to obtain coded data variable-length encodedaccording to an entropy coding rule in which coded data of a lengthbased on the frequency of occurrence of each data value in the firstdata is assigned.
 35. A data processing apparatus according to claim 34,wherein said first decoding means modifies coded data associated witheach data value in the first data, to which coded data of the samelength is assigned, based on the frequency of occurrence of each datavalue in the first data and the frequency of occurrence of each datavalue in decoded data obtained by variable-length decoding the embeddedcoded data, thereby restoring the embedded coded data into the codeddata variable-length encoded according to the entropy coding rule.
 36. Adata processing apparatus according to claim 35, wherein said firstdecoding means comprises translation table creation means for creating atranslation table for translating coded data in a coding table forvariable-length encoding the first data into coded data, based on thefrequency of occurrence of each data value in the first data and thefrequency of occurrence of each data value in decoded data obtained byvariable-length decoding the embedded coded data.
 37. A data processingapparatus according to claim 33, wherein said first decoding meansdecodes the embedded coded data to obtain tentative coded data, saidsecond decoding means decodes the tentative coded data to outputtentative decoded data, said data processing apparatus furthercomprising determination means for determining whether the tentativedecoded data is correct.
 38. A data processing apparatus according toclaim 37, wherein said determination means determines whether thetentative decoded data is correct by encoding the tentative decoded dataaccording to the entropy coding rule.
 39. A data processing apparatusaccording to claim 38, wherein said determination means determineswhether the tentative decoded data is correct by comparing re-encodeddata obtained by encoding the tentative decoded data according to theentropy coding rule with the tentative coded data.
 40. A data processingapparatus according to claim 37, wherein said first decoding meansdecodes the embedded coded data obtained by manipulating, based on thesecond data, a quantization error of coded data including quantizationcode and quantization error obtained by quantizing the first data, bymanipulating the quantization error, thereby obtaining the tentativecoded data.
 41. A data processing apparatus according to claim 40,wherein said determination means determines whether a quantization codeand a quantization error constituting the tentative coded data arecorrect by comparing the quantization code and the quantization errorconstituting the tentative coded data with a re-quantization code and are-quantization error obtained by re-quantizing tentative decoded dataobtained by decoding the quantization code and the quantization error.42. A data processing apparatus according to claim 33, wherein the firstdata is image data.
 43. A data processing system comprising an encodingapparatus comprising: encoding means for encoding first data accordingto a compression coding rule to output coded data; and modificationmeans for modifying the compression coding rule based on second data;wherein said encoding means encodes the first data according to thecompression coding rule modified by said modification means to generateembedded data in which the second data is embedded, said data processingsystem also comprising a decoding apparatus comprising: first decodingmeans for decoding embedded coded data to obtain the coded data encodedaccording to the compression coding rule and to obtain the second data;and second decoding means for decoding the coded data to obtain thefirst data.
 44. A data processing method comprising the steps of:statistically analyzing data values included in first data and creatinga coding table for encoding the first data into coded data based on aresult of the statistical analysis; generating and outputting coded databy encoding the first data based on the coding table created; andembedding second data in the outputted coded data by modifying a portionof the outputted coded data based on the second data.
 45. A dataprocessing method comprising the steps of: statistically analyzing datavalues included in first data and creating a coding table for encodingthe first data into coded data based on a result of the statisticalanalysis; modifying the coding table created based on second data tocreate a modified coding table; and encoding the first data based on themodified coding table to generate embedded coded data in which thesecond data is embedded.
 46. A data processing method, wherein embeddedcoded data encoded by embedding second data in first data is tentativelydecoded based on a coding table to output tentative decoded data, atentative coding table is created based on the tentative decoded data,the embedded coded data is decoded based on the coding table and thetentative coding table to obtain first decoded data, and the codingtable is compared with the tentative coding table to obtain seconddecoded data.
 47. A data processing method, wherein a portion ofembedded coded data encoded by embedding second data in first data ismodified according to an input parameter, and tentatively decoded basedon a coding table to output tentative decoded data, the tentativedecoded data is re-encoded to output re-encoded data, and the parameteris determined by comparing the embedded coded data and the re-encodeddata, and tentative decoded data obtained by tentatively decoding, basedon the coding table, the embedded coded data having been partiallymodified based on the parameter, is output as first decoded data, andfor second decoded data corresponding to the parameter is also obtained.48. A data processing method, wherein first data is encoded according toa compression coding rule to output coded data, the coding rule ismodified based on second data, and the first data is encoded accordingto the modified coding rule to generate embedded coded data in which thesecond data is embedded.
 49. A data processing method, wherein embeddedcoded data obtained by embedding second data in first data is decoded toobtain coded data encoded according to an entropy coding rule and toobtain the second data, and the coded data is decoded to obtain thefirst data.
 50. A storage medium storing a program readable by aprocessing device to carry out a method comprising the steps of:statistically analyzing data values included in first data and creatinga coding table for encoding the first data into coded data based on aresult of the statistical analysis; generating and outputting coded databy encoding the first data based on the coding table created; andembedding second data in the outputted coded data by modifying a portionof the outputted coded data based on the second data.
 51. A storagemedium storing a program readable by a processing device to carry out amethod comprising the steps of: statistically analyzing data valuesincluded in first data and creating a coding table for encoding thefirst data into coded data based on a result of the statisticalanalysis; modifying the coding table created based on second data tocreate a modified coding table; and encoding the first data based on themodified coding table to generate embedded coded data in which thesecond data is embedded.
 52. A storage medium storing a program, whereinembedded coded data encoded by embedding second data in first data istentatively decoded based on a coding table to output tentative decodeddata, a tentative coding table is created based on the tentative decodeddata, the embedded coded data is decoded based on the coding table andthe tentative coding table to obtain first decoded data, and the codingtable is compared with the tentative coding table to obtain seconddecoded data.
 53. A storage medium storing a program, wherein a portionof embedded coded data encoded by embedding second data in first data ismodified according to an input parameter, and tentatively decoded basedon a coding table to output tentative decoded data, the tentativedecoded data is re-encoded to output re-encoded data, and the parameteris determined by comparing the embedded coded data and the re-encodeddata, and tentative decoded data obtained by tentatively decoding, basedon the coding table, the embedded coded data having been partiallymodified based on the parameter, is output as first decoded data, andfor second decoded data corresponding to the parameter is also obtained.54. A storage medium storing a program, wherein first data is encodedaccording to a compression coding rule to output coded data, the codingrule is modified based on second data, and the first data is encodedaccording to the modified coding rule to generate embedded coded data inwhich the second data is embedded.
 55. A storage medium storing aprogram, wherein embedded coded data obtained by embedding second datain first data is decoded to obtain coded data encoded according to anentropy coding rule and to obtain the second data, and the coded data isdecoded to obtain the first data.